#!/bin/sh
# showpass.sh - Using read to process a text file
########################################

IFS=:
# 传入给该脚本的参数是一个文件，read从该文件中每次读入一行，以：为分隔符，
# 将值分别赋给read后面的参量
# Usage:    showpass.sh < /etc/passwd
#   or      cat /etc/passwd | ./showpass.sh            
while read name pass uid gid gecos home shell
do
    echo "*********************************"
    echo "name  : $name"
    echo "pass  : $pass"
    echo "uid   : $uid"
    echo "gid   : $gid"
    echo "gecos : $gecos"
    echo "home  : $home"
    echo "shell : $shell"
done
